<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 数组的解构赋值
        let arr = [1,2,3]
        let [d,e,f,g = 10] = arr;
        console.log(d,e,f,g)
        // 对象的解构赋值, 变量名必须和属性名一致
        let obj = {name:'zhangsan',age:18}
        let {name,age} = obj;
    </script>
</head>
<body>
    
</body>
</html>